﻿using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
using DCT.ViewModel;

namespace DCT.View
{
    [ValueConversion(typeof(EditModeState), typeof(Visibility))]
    public class EditModeToVisibleConverter : IValueConverter
    {
        public object Convert(object value, Type typeTarget, object param, CultureInfo culture)
        {
            if (typeTarget == typeof(Visibility))
            {
                return ((EditModeState)value == EditModeState.DrawTrackSegment || (EditModeState)value == EditModeState.DrawSwitch) ? Visibility.Visible : Visibility.Hidden;
            }

            return null;
        }
        public object ConvertBack(object value, Type typeTarget, object param, CultureInfo culture)
        {
            return null;
        }
    }
}
